Skip to main content

Strings

String resources of the library are stored in the directory res/values/strings.xml. Replacement and localization of string resources follow the standard Android development algorithm:

  1. To replace string resources without localization, you need to override the modifiable parameters in the res/values/strings.xml file inside the Host App.

    Example:

    1. Select the string resource that needs to be modified. In our example, it's the text 'Create custom' on the aggregation selection screen. In the original strings.xml file, it looks like this:

      <resources>
      //...
      <string name="custom_aggregation_label">Create custom</string>
      //...
      </resources>
    2. Inside the Host App, in the file res/values/strings.xml, create a parameter with the same name as the one being modified.

      <resources>
      <string name="app_name">your app name</string>
      <string name="custom_aggregation_label"></string>
      </resources>
    3. Write the new value for the string parameter

      <resources>
      <string name="app_name">your app name</string>
      <string name="custom_aggregation_label">Test</string>
      </resources>
    4. Run the Host App and ensure that the string resource has been modified

  2. Localization of string resources in Android is described in the official documentation by Google, and you can follow the guidelines: https://developer.android.com/guide/topics/resources/localization. This allows you to define sets of string resources for multiple languages, and system will automatically select the appropriate set based on the device's locale settings.

The original strings.xml file with all the parameters used in the library can be found here: https://stash.in.devexperts.com/projects/DXCHARTS/repos/dxcharts-android/browse/dxcharts_lib/src/main/res/values/strings.xml